const Background = imports.ui.background;
const BackgroundMenu = imports.ui.backgroundMenu;
-const LoginManager = imports.misc.loginManager;
const DND = imports.ui.dnd;
const Main = imports.ui.main;
monitorManager.connect('monitors-changed',
this._monitorsChanged.bind(this));
this._monitorsChanged();
-
- // NVIDIA drivers don't preserve FBO contents across
- // suspend/resume, see
- // https://bugzilla.gnome.org/show_bug.cgi?id=739178
- if (Shell.util_need_background_refresh()) {
- LoginManager.getLoginManager().connect('prepare-for-sleep',
- (lm, suspending) => {
- if (suspending)
- return;
- Meta.Background.refresh_all();
- });
- }
}
// This is called by Main after everything else is constructed
typedef const gchar *(*ShellGLGetString) (GLenum);
-static const gchar *
-get_gl_vendor (void)
-{
- static const gchar *vendor = NULL;
-
- if (!vendor)
- {
- ShellGLGetString gl_get_string;
- gl_get_string = (ShellGLGetString) cogl_get_proc_address ("glGetString");
- if (gl_get_string)
- vendor = gl_get_string (GL_VENDOR);
- }
-
- return vendor;
-}
-
-gboolean
-shell_util_need_background_refresh (void)
-{
- if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
- return FALSE;
-
- if (g_strcmp0 (get_gl_vendor (), "NVIDIA Corporation") == 0)
- return TRUE;
-
- return FALSE;
-}
-
static gboolean
canvas_draw_cb (ClutterContent *content,
cairo_t *cr,
int height,
int rowstride);
-gboolean shell_util_need_background_refresh (void);
-
ClutterContent * shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
MetaRectangle *window_rect);